﻿using System;
using System.Collections;
using System.Text;

namespace HellaDotNet.XmlRPC
{
    public class Methods : CollectionBase
    {
        public void Add(Method method)
        {
            this.InnerList.Add(method);
        }

        public Method this[Int32 index] { get { return (Method)this.InnerList[index]; } set { this.InnerList[index] = value; } }

        public Method this[string name]
        {
            get
            {
                Method result = new Method();
                foreach (Method method in this.InnerList)
                {
                    if (method.Name.Equals(name))
                    {
                        result = method;
                    }
                }
                return result;
            }
        }
    }
}
